Skip to content

ui: NMD 917 - UI not updating on region switch#27886

Open
arunstanhc wants to merge 13 commits intomainfrom
NMD-917-core-issue
Open

ui: NMD 917 - UI not updating on region switch#27886
arunstanhc wants to merge 13 commits intomainfrom
NMD-917-core-issue

Conversation

@arunstanhc
Copy link
Copy Markdown
Collaborator

@arunstanhc arunstanhc commented Apr 29, 2026

Description

This PR fixes the issue when allocations view is not updated when switching region. This leads to user seeing incorrect data and further errors when they try to interact with it - for eg. trying to access a job not existing in the newly switched region.

The changes in the PR are as below:

  • The region change was not being detected correctly in the application router when comparing active region and region from query params
  • Updated region switcher to not set the active region and let it be updated by application router after comparing with query params
  • Removed global store.unloadAll which was causing rendering errors and replaced it with route.refresh to reload active route models for the selected region
  • Updated child detail routes (job and allocation) to explicitly reload related region data, avoiding reuse of stale cache after switching regions
  • Added new tests to verify loading of jobs and job detail data with the selected region
  • Updated failing tests to reflect the change in logic for explicit loading job and job detail data

Testing & Reproduction steps

To reproduce the issue, set up Nomad instances with two regions and deploy a job to the federated cluster.

  • Start instance for region 1
bin/nomad agent -dev -config=india-dev.hcl
  • Start instance for region 2
bin/nomad agent -dev -config=us-dev.hcl
  • Join the instances and deploy a sample job in both instances
bin/nomad server join -address=http://127.0.0.1:5646 127.0.0.1:4648
bin/nomad job run -region=india minimal-job.nomad
bin/nomad job run -region=us minimal-job.nomad
  • Launch UI and navigate to jobs view http://localhost:4646/ui/jobs/example
  • Switch between regions and observe the recent allocations data does not refresh
  • Also click on an allocation id after switching initial region to observe object not found error

To verify the fix, please make another build with the PR branch and repeat the above steps

make dev-ui

You should see updated data for relevant region without any errors

Including the files mentioned above for reference:
NMD917-test-files.zip

Links

JIRA

Contributor Checklist

  • Changelog Entry If this PR changes user-facing behavior, please generate and add a
    changelog entry using the make cl command.
  • Testing Please add tests to cover any new functionality or to demonstrate bug fixes and
    ensure regressions will be caught.
  • Documentation If the change impacts user-facing functionality such as the CLI, API, UI,
    and job configuration, please update the Nomad product documentation, which is stored in the
    web-unified-docs repo. Refer to the web-unified-docs contributor guide for docs guidelines.
    Please also consider whether the change requires notes within the upgrade
    guide
    . If you would like help with the docs, tag the nomad-docs team in this PR.

Reviewer Checklist

  • Backport Labels Please add the correct backport labels as described by the internal
    backporting document.
  • Commit Type Ensure the correct merge method is selected which should be "squash and merge"
    in the majority of situations. The main exceptions are long-lived feature branches or merges where
    history should be preserved.
  • Enterprise PRs If this is an enterprise only PR, please add any required changelog entry
    within the public repository.
  • If a change needs to be reverted, we will roll out an update to the code within 7 days.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

…ring task-linked variables are loaded and the link rerenders correctly.
…tead assert against fields from the Mirage-created job loaded by the test.
@arunstanhc arunstanhc changed the title NMD 917 core issue ui: NMD 917 - UI not updating on region switch May 3, 2026
@arunstanhc arunstanhc marked this pull request as ready for review May 3, 2026 18:46
@arunstanhc arunstanhc requested review from a team as code owners May 3, 2026 18:46
@arunstanhc arunstanhc requested a review from tehut May 4, 2026 14:44
Copy link
Copy Markdown
Contributor

@tehut tehut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arunstanhc I really appreciated you including the configuration files, it really sped up my replication efforts. Thank you!

I'm sorry that #27899 landed while I was still reviewing this. I was able to run everything as described and was able to follow the logic but I don't want to approve it before you've rebased since there will probably be some substantive changes to bring everything into ember 6.0

@arunstanhc
Copy link
Copy Markdown
Collaborator Author

arunstanhc commented May 6, 2026

@arunstanhc I really appreciated you including the configuration files, it really sped up my replication efforts. Thank you!

I'm sorry that #27899 landed while I was still reviewing this. I was able to run everything as described and was able to follow the logic but I don't want to approve it before you've rebased since there will probably be some substantive changes to bring everything into ember 6.0

@tehut Sure, glad that it was useful. No worries, I have now resolved the merge conflicts and everything looks fine after a round of testing. Please take a look again. Thank you!

Copy link
Copy Markdown
Contributor

@tehut tehut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @arunstanhc, 🚢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants